package com.fw.service.formvalidator;

import java.util.Date;
import java.util.List;

import com.fw.service.bean.BaseBean;
import com.fw.service.persistence.dto.Error;

/**
 * Description: From Validator Service
 * 
 * @author AS073
 *
 */
public interface FormValidatorService {

    public static final String PATTERN_ALPHABET_TH = "[\\p{InThai}]*";

    public static final String PATTERN_ALPHABET_EN = "[A-Za-z]*";

    public static final String PATTERN_ALPHA_MERIC_TH = "[\\p{InThai}0-9]*";

    public static final String PATTERN_ALPHA_MERIC_EN = "[A-Za-z0-9]*";

    public static final String PATTERN_NAME_EN = "[A-Za-z0-9 @&-_.(),;]*";

    public static final String PATTERN_NAME_TH = "[A-Za-z0-9\\p{InThai} @&-_.(),;]*";
    
    public static final String PATTERN_NAME = "[A-Za-z0-9\\p{InThai}]*";

    public static final String PATTERN_EMAIL = "([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})";

    public static final String PATTERN_EMAILS = "(([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4}))(((;|,){1}"
	    + "([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})){0,9})";

    public static final String PATTERN_URL = "\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";

    public static final String PATTERN_PERCENT = "^([1-9]{0,1})([0-9]{0,1})[0-9](\\.[0-9]{1,2})?$";

    public static final String PATTERN_NUMBER = "[0-9]*";

    public static final String PATTERN_LIMIT_NUMBER = "^[1-9][0-9]{0,8}+|0|-1?$";
    
    public static final String PATTERN_TRANSACTION_LIMIT_NUMBER = "^[1-9][0-9]{0,4}+|0|-1?$";

    public Boolean validateUrl(String value);

    public Boolean validateNameEN(String value);

    public Boolean validateNameTH(String value);

    public Boolean validateLength(String value, int length);

    public Boolean validateEmail(String value);

    public Boolean validateEmails(String value);

    public Boolean validateMandatory(Object value);

    public Boolean validateAlphabetTH(String value);

    public Boolean validateAlphabetEN(String value);

    public Boolean validateAlphaMericTH(String value);

    public Boolean validateAlphaMericEN(String value);

    public Boolean validateFromTo(Date dateFrom, Date dateTo);

    public Boolean validateMatch(String expected, String actual);

    public Boolean validatePattern(String value, String pattern);

    public Boolean validateMin(Object value, Object minValue);

    public Boolean validateMax(Object value, Object maxValue);

    public Boolean validatePercent(String value);

    public Boolean validateNumber(String value);

    public Boolean validateLimitNumber(String value);

    public List<Error> validate(String clazz, String method, BaseBean baseBean);

}
